<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>评论管理</title>
<link rel="stylesheet" type="text/css" href="../css/style1.css" />
<link rel="stylesheet" type="text/css" href="../css/base.css" />
<link rel="stylesheet" type="text/css" href="../css/indexbody.css" />
<script type="text/javascript" src="../js/frame.js"></script>
<script type="text/javascript" src="../js/jquery-1.8.0.min.js"></script>

<script type="text/javascript">
	window.onload = function() {
		document.getElementById("hide").style.display = "block";
		document.getElementById("sc").style.display = "none";
		document.getElementById("vip").style.display = 'none';
		document.getElementById("mb").style.display = 'none';
		document.getElementById("sys").style.display = 'none';
	}
	//反选
	function ReSel() {
		$(":checkbox").each(function() {
			$(this).attr("checked", !this.checked);
		});
	}

	//全选
	function SelAll() {
		$(":checkbox").each(function() {
			$(this).attr("checked", true);
		});
	}

	//取消
	function NoneSel() {
		$(":checkbox").each(function() {
			$(this).attr("checked", false);
		});
	}
	function deletems() {
		document.from1.action = "message!deletems.action";
		document.from1.submit();
	}
	function checkms() {
		document.from1.action = "message!checkms.action";
		document.from1.submit();
	}
</script>

</head>

<body background='../images/allbg.gif' leftmargin='8' topmargin='8'>
	<div id="container">
		<jsp:include page="../header.jsp"></jsp:include>
		<div style="float:left; width:195px;">
			<jsp:include page="../leftnav.jsp"></jsp:include>
		</div>
		<div
			style="float:left; overflow-y:scroll; overflow-x:hidden; width: 785px; height: 550px;">
			<table width="98%" border="0" cellpadding="3" align="center"
				cellspacing="1" bgcolor="#D6D6D6">
				<tr>
					<td height="28" background='../images/tbg.gif'
						style="padding-left:-10px;">
						<div style="float:left;">
							<u><b>留言管理 </b> </u>
						</div>
					</td>
				</tr>
				<form name="form1" id="from1" onSubmit="" action="" method="post">
					<table width="99%" border="0" bgcolor="#D6D6D6">
						<tr bgcolor="#FBFCE2">
							<td height="27%" width="10%" align="center">选择</td>
							<td width="20%" align="center">用户</td>
							<td width="35%" align="center">时间</td>
							<td width="35%" align="center">文档</td>
						</tr>
						<s:iterator value="messagesList">
							<tr align='center' bgcolor='#FFFFFF' height='24'>
								<td><input type="checkbox" name="checks" value="${id}" />
								</td>
								<td>${userName}</td>
								<td>${createTime}</td>
								<td><s:if test="status==1">
										<a href='message!checkms.action?check=${id}'><u>审核</u> </a>
									</s:if> <s:else>已审核</s:else> <a
									href="message!deletem.action?check=${id}" target="_blank"><u>删除</u>
								</a><a href="message.action!hu?check=${users.id}" target="_blank"><u>回复</u>
								</a></td>
							</tr>
						</s:iterator>
						<tr>
						<td colspan="4" align="center" >
							<pg:pager items="${total }" maxIndexPages="5" maxPageItems="2" url="message!getAllByPages.action"
								export="currentPageNumber=pageNumber" >
								<pg:index>
									<pg:first>
										<a href="${pageUrl}"><nobr>[首页]</nobr> </a>
									</pg:first>
									<pg:prev>
										<a href="${pageUrl}">前一页</a>
									</pg:prev>
									<pg:pages>
										<c:choose>
											<c:when test="${currentPageNumber eq pageNumber}">
												<font color="red">&nbsp;[${pageNumber}]</font>
											</c:when>
											<c:otherwise>
												<a href="${pageUrl}">&nbsp;[${pageNumber}]</a>
											</c:otherwise>
										</c:choose>
									</pg:pages>
									<pg:next>
										<a href="${pageUrl}">下一页</a>
									</pg:next>
									<pg:last>
										<a href="${pageUrl}"><nobr>[尾页]</nobr> </a>
									</pg:last>
								</pg:index>
							</pg:pager>
							</td>
						</tr>
						<tr>
							<td height="24" colspan="2">&nbsp; <input name="b1"
								type="button" id="b1" class="coolbg np" onClick="SelAll()"
								value="全选" /> &nbsp; <input name="b2" type="button" id="b2"
								class="coolbg np" onClick="ReSel()" value="反选" /> &nbsp; <input
								name="b3" type="button" id="b3" class="coolbg np"
								onClick="NoneSel()" value="取消" />
							</td>
							<td align="right" colspan="2"><input type='button'
								id='dltms' value=' 删除留言 ' onclick="deletems()" /> <input
								type='button' id='ckems' value='审核留言' onclick="checkms()" />
							</td>
						</tr>
					</table>
				</form>
			</table>
		</div>
	</div>
</body>

</html>
